<?php
declare (strict_types = 1);

namespace thinkless\patch;

use think\response\View;

/**
 * View Response
 */
class ContentView extends View {
    

    /**
     * 处理数据
     * @access protected
     * @param  mixed $data 要处理的数据
     * @return string
     */
    protected function output($data): string
    {
        if($this->isContent()) {
            // 渲染模板输出
            return $this->view->filter($this->filter)
                ->display($data, $this->vars);
        } else {
            // 渲染模板输出
            return $this->view->filter($this->filter)
                ->fetch($data, $this->vars);
        }
    }
}